#include <iostream>
using namespace std;
int main ()
{
    int vector[50],i, variable1, variable2,n;

    n=0;
    while (n<50)
    {
        cout << "Ingrese un numero" << endl;
        cin >> vector[n];

        if (vector[n]==0)
        {
                break;
        }
    n++;

    }
    variable1 = vector[0];
    variable2 = vector[0];
    i=0;
    while (i<n)
    {
        if (variable1 < vector[i])
        {
            variable1=vector[i];
        }
        if (variable2 > vector[i])
        {
            variable2=vector[i];
        }
    i++;
    }
    cout << "El mayor es: " << variable1 << endl;;
    cout << "El menor es: " << variable2;
}
